<template>
    <h2>学生详细信息</h2>
    <div>
        <p>学号：{{ route.params.studentNo }}</p>
    </div>
    <div>
        <RouterLink :to="'/students/' + (parseInt(route.params.studentNo) + 1)">下一学生</RouterLink>
    </div>
</template>

<script setup>
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';
import axios from 'axios';

const route = useRoute();
const studentNo = route.params.studentNo;

onMounted(() => {
    // 向后端发请求，传给后端学生学号，获取指定学生信息
    axios.get('/get-student-info?student-no=' + studentNo)
    console.log(studentNo);
})
</script>
